<template>
  <view class="container">
    <headertit :title="title" :showFilter="false" />
    <view class="detail">
      <ve-cell label="ID">{{ record.id || '-' }}</ve-cell>
      <ve-cell label="车牌号">{{ record.licenseNo || '-' }}</ve-cell>
      <ve-cell label="车型">{{ record.modelName || '-' }}</ve-cell>
      <ve-cell label="门店">{{ record.siteName || '-' }}</ve-cell>
      <ve-cell label="车辆未处理天数">{{ record.lastHandleDay || '-' }}</ve-cell>
      <ve-cell label="上次处理日期">{{ record.lastHandleTime || '-' }}</ve-cell>
      <ve-cell label="占用原因">{{ record.refTypeName || '-' }}</ve-cell>
      <ve-cell label="提醒时间">{{ record.warningTime || '-' }}</ve-cell>
      <template v-if="storage.status == '1'">
        <ve-cell label="处理人">{{ record.handlerUserName || '-' }}</ve-cell>
        <ve-cell label="处理时间">{{ record.handlerTime || '-' }}</ve-cell>
        <ve-cell label="处理原因">{{ record.remark || '-' }}</ve-cell>
      </template>
    </view>
    <view class="btn" v-if="storage.status == '0'">
      <ve-bottom-box size="mini">
        <ve-button v-if="userStore().v_auth('svmapp:1:operation:inspectedhandle')" type="primary" size="long" @click="onhandle()"
          >处理</ve-button
        >
      </ve-bottom-box>
      <handle v-model="visible" @confirm="handleConfirm"></handle>
    </view>
  </view>
</template>
<script setup lang="ts">
  import { ref, onMounted } from 'vue'
  import headertit from './components/headertit.vue'
  import { viewHandler } from '@/api/dict/operate'
  import handle from './components/handle.vue'
  import { userStore } from '@/stores'
  const visible = ref(false)
  const onhandle = () => {
    visible.value = true
  }
  const handleConfirm = async (val) => {
    const res = await viewHandler({ remark: val, id: record.value.id })
    if (res.code === 200) {
      visible.value = false
      uni.navigateBack()
    }
  }
  // 页面参数
  let storage = uni.getStorageSync('operateAmount')
  const title = ref('')
  const record = ref<any>({})
  onMounted(() => {
    title.value = storage.status == '0' ? '待处理详情' : '已处理详情'
    record.value = storage.item
  })
</script>
<style scoped lang="less">
  .detail {
    margin: 24rpx;
    padding: 24rpx;
    background: #fff;
    .back {
      background: #f7f8fa;
      padding: 32rpx 24rpx;
    }
    .detail-tit {
      font-size: 30rpx;
      font-family: PingFang SC-Regular, PingFang SC;
      font-weight: 400;
      color: #8491a8;
      display: inline-block;
      margin: 8rpx 0;
    }
  }
</style>
@/api/dict/operate
